/*
 * @Author: Zyunchao 18651805393@163.com
 * @Date: 2022-07-11 11:21:10
 * @LastEditors: Zyunchao 18651805393@163.com
 * @LastEditTime: 2023-02-15 11:22:17
 * @FilePath: /micro-temp-monorepo/_core/microMain/register.ts
 * @Description: 微应用注册列表，常用于嵌套远程组件的注册
 */
import microApp from '@micro-zoe/micro-app'
import currentMicroTagName from './currentMicroTagName'

const microAppList = window['__MICRO_APP_LIST__']

/**
 * 静态注册文件长度是否有意义
 */
if (microAppList && microAppList.length) {
    microApp.start({
        tagName: currentMicroTagName,
        preFetchApps: microAppList.map((app) => ({
            name: app.name,
            url: app.url
        }))
    })
}
